package main.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import main.pojo.User;
import main.servlet.service.OutputService;
import main.servlet.service.impl.OutputServiceImpl;

/**
 * 返回成功注册，和用户信息table给浏览器
 */
public class SuccessMsgServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		this.doPost(request, response);
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		OutputService service = new OutputServiceImpl();
		response.setContentType("text/html;charset=utf-8");
		////让负责打印的Servlet进行打印
		service.printUserTable((List<User>) request.getAttribute("userList"), response.getWriter());
	
		
	}

}
